<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>滚动视差效果</title>
    <link rel="stylesheet" href="style.css">
</head>
<body>
    <div class="content">
        <div class="image" style="background-image: url(./static/hmbb.jpg);">
        </div>
        <div class="title">
            <h1>HMBB HMBB</h1>
        </div>
        <div class="desc">
            <h1>HSZZ HSZZ</h1>
        </div>

        <div class="image" style="background-image: url(./static/shu.jpg);">
        </div>
        <div class="title">
            <h1>TREE TREE</h1>
        </div>
        <div class="desc">
            <h1>HSZZ HSZZ</h1>
        </div>

        <div class="image" style="background-image: url(./static/megalobox.jpeg);">
        </div>
        <div class="title">
            <h1>MEGALOBOX MEGALOBOX</h1>
        </div>
        <div class="desc">
            <h1>HSZZ HSZZ</h1>
        </div>
    </div>
</body>
</html>

<!-- 原理 -->
<!-- perspective让父元素获得3d视角 -->
<!-- image在z轴为-1，再放大1.6，看起来就和原本一样大 -->
<!-- 然后 image、title、desc 的z轴分别为-1，1，0-->
<!-- z轴值越大，鼠标滚动移动距离越大；看起来title速度>desc速度>image速度，形成了视差-->
